<?php
$this->pageTitle=Yii::app()->name . ' - Contact Us';
$this->breadcrumbs=array(
	'Contact',
);
?>

<?php if(Yii::app()->user->hasFlash('contact')): ?>

<div class="flash-success">
	<?php echo Yii::app()->user->getFlash('contact'); ?>
</div>

<?php else: ?>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'contact-form',
	'enableClientValidation'=>true,
	'clientOptions'=>array(
		'validateOnSubmit'=>true,
	),
	'htmlOptions'=>array(
		'class'=>'form-horizontal',
	)
)); ?>
<fieldset  class='div div-plain'>

	<h2 class='div'>欢迎联系<?php echo Yii::app()->name?>	</h2>

	<div class="control-group">
		<label class='control-label'><?php echo $form->labelEx($model,'name'); ?></label>
		<div class="controls">
		<?php echo $form->textField($model,'name'); ?>
			<?php if($form->error($model,'name')): ?>
			<span class="label important"><?php echo $form->error($model,'name'); ?>
			</span>
			<?php endif;?>
		</div>
	</div>


	<div class="control-group">
		<label class='control-label'><?php echo $form->labelEx($model,'email'); ?></label>
		<div class="controls">
		<?php echo $form->textField($model,'email'); ?>
			<?php if($form->error($model,'email')): ?>
			<span class="label important"><?php echo $form->error($model,'email'); ?>
			</span>
			<?php endif;?>
		</div>
	</div>
	
	<div class="control-group">
		<label class='control-label'><?php echo $form->labelEx($model,'subject'); ?></label>
		<div class="controls">
		<?php echo$form->textField($model,'subject',array('size'=>60,'maxlength'=>128)); ?>
			<?php if($form->error($model,'subject')): ?>
			<span class="label important"><?php echo $form->error($model,'subject'); ?>
			</span>
			<?php endif;?>
		</div>
	</div>
	
	<div class="control-group">
		<label class='control-label'><?php echo $form->labelEx($model,'body'); ?></label>
		<div class="controls">
		<?php echo $form->textArea($model,'body',array('rows'=>6, 'cols'=>50)); ?>
			<?php if($form->error($model,'body')): ?>
			<span class="label important"><?php echo $form->error($model,'body'); ?>
			</span>
			<?php endif;?>
		</div>
	</div>

	<?php if(CCaptcha::checkRequirements()): ?>
		<div class="control-group">
		<label class='control-label'><?php echo $form->labelEx($model,'verifyCode'); ?></label>
		<div class="controls">
		
			<?php echo $form->textField($model,'verifyCode'); ?>
			<?php if($form->error($model,'verifyCode')): ?>
			<span class="label important"><?php echo $form->error($model,'verifyCode'); ?>
			</span>
			<?php endif;?>
			<br/>
			<?php $this->widget('CCaptcha'); ?>
		</div>
	</div>
	<?php endif; ?>
	<div class="form-actions">
		<input type="submit" value="发送" class="btn btn-primary">
	</div>
</fieldset>
<?php $this->endWidget(); ?>

</div><!-- form -->

<?php endif; ?>